package com.karrim.server.module;

import com.google.inject.AbstractModule;
import com.google.inject.Singleton;
import com.karrim.server.annotation.Annotation.Portable.PortableSet;
import com.karrim.server.annotation.Annotation.ScannedPackage;
import com.karrim.server.io.JClassLoader;
import com.karrim.server.portable.PortableClassScanner;
import com.karrim.server.provider.HashSetProvider;
import java.util.HashSet;
import java.util.Set;

/**
 *
 * @author andrea.cantafio
 */
public class ReflectionModule extends AbstractModule {

    @Override
    protected void configure() {
        bind(HashSet.class).toProvider(new HashSetProvider());
        bind(JClassLoader.class);
        bind(PortableClassScanner.class);
        bind(Set.class).annotatedWith(PortableSet.class).to(HashSet.class).in(Singleton.class);
        bindConstant().annotatedWith(ScannedPackage.class).to("com.karrim.server.model.entity");
    }
}
